Skip to content

Document IsFromUnhandledException/IsFromTerminalException API (.NET)#18676

Merged
jamescrosswell merged 5 commits into
masterfrom
jamescrosswell/document-unhandled-exception-api-5348
Jul 10, 2026
Merged

Document IsFromUnhandledException/IsFromTerminalException API (.NET)#18676
jamescrosswell merged 5 commits into
masterfrom
jamescrosswell/document-unhandled-exception-api-5348

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

DESCRIBE YOUR PR

Documents the new SentryEvent.IsFromUnhandledException() and SentryEvent.IsFromTerminalException() extension methods (added in getsentry/sentry-dotnet#5177) so users can find them where they're most likely to be used — the before-send filtering docs.

  • Adds a "Filtering by Unhandled or Terminal Exceptions" subsection under Using before-send in the .NET filtering docs
  • Explains the difference between unhandled and terminal exceptions
  • Provides C# and F# examples for filtering handled exceptions while always sending unhandled ones

Closes getsentry/sentry-dotnet#5348

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline: Release of sentry-dotnet v6.7.0
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Adds a subsection under the .NET before-send filtering docs covering the
new SentryEvent extension methods introduced in sentry-dotnet#5177, with
C# and F# examples showing how to filter by handled/unhandled/terminal
status.

Closes getsentry/sentry-dotnet#5348

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Jul 10, 2026 12:06am
sentry-docs Ready Ready Preview, Comment Jul 10, 2026 12:06am

Request Review

Comment thread docs/platforms/dotnet/common/configuration/filtering.mdx Outdated
Comment thread docs/platforms/dotnet/common/configuration/filtering.mdx Outdated
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
@jamescrosswell jamescrosswell requested a review from Flash0ver July 9, 2026 01:35
@jamescrosswell jamescrosswell marked this pull request as ready for review July 9, 2026 01:35
Comment thread docs/platforms/dotnet/common/configuration/filtering.mdx
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@Flash0ver Flash0ver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit-picky suggestion/question.
Merge after release of sentry-dotnet v6.7.0.

Comment on lines +54 to +55
open Sentry
open System.Net.Http

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: F# has no implicit usings / opens

Comment thread docs/platforms/dotnet/common/configuration/filtering.mdx
Rename the before-send callback parameter from `event` to `sentryEvent`
in the F# sample. This matches the C# sample and the new unhandled-
exception example, and avoids `event`, which is reserved as a keyword
for future expansion of F#.

Refs GH-5348
Co-Authored-By: Claude <noreply@anthropic.com>
@codeowner-assignment codeowner-assignment Bot requested a review from a team July 9, 2026 23:49
@jamescrosswell jamescrosswell enabled auto-merge (squash) July 9, 2026 23:51
}

// Drop noisy handled exceptions
if (sentryEvent.Exception is HttpRequestException)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The C# code example uses HttpRequestException but is missing the required using System.Net.Http; directive, which will cause compilation errors for some users copying the code.
Severity: LOW

Suggested Fix

Add the using System.Net.Http; directive at the top of the C# code block to ensure the example compiles correctly for all users, regardless of their project's implicit using settings.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docs/platforms/dotnet/common/configuration/filtering.mdx#L44

Potential issue: The C# code example in the documentation uses `HttpRequestException`
without including the necessary `using System.Net.Http;` directive. While projects using
.NET 6+ with implicit usings enabled will compile this code, it will fail for users on
other platforms like .NET Framework, older .NET Core versions, or Unity. This creates a
poor user experience as copied code will not work out-of-the-box. The corresponding F#
example correctly includes its equivalent import (`open System.Net.Http`), suggesting
this was an unintentional omission.

@jamescrosswell jamescrosswell merged commit ce86c37 into master Jul 10, 2026
24 checks passed
@jamescrosswell jamescrosswell deleted the jamescrosswell/document-unhandled-exception-api-5348 branch July 10, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document API for checking unhandled exceptions

2 participants